//------------------------------------------------------------------------------
//  <copyright file="PathPlan.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
//  </copyright>
//------------------------------------------------------------------------------

namespace Microsoft.Robotics.Navigation.Motion
{
    using System;
    using System.Collections.Generic;
    using System.Runtime.Serialization;
    using Microsoft.Robotics.Navigation.Localization;
    using Microsoft.Robotics.Numerics;

    /// <summary>
    /// Points forming a path through open space from the robot to a goal location.
    /// </summary>
    [DataContract]
    public class PathPlan
    {
        /// <summary>
        /// Initializes a new instance of the PathPlan class.
        /// </summary>
        /// <param name="path">Planned path of occupancy map points.</param>
        /// <param name="pose">Location and heading of the robot.</param>
        /// <param name="target">Target robot pose.</param>
        /// <param name="map">Occupancy map.</param>
        public PathPlan(IEnumerable<Point2D<int>> path, Pose2D pose, Pose2D target, GlobalMap map)
        {
            this.Path = path;
            this.CurrentPose = pose;
            this.TargetPose = target;
            this.Map = map;
        }

        /// <summary>
        /// Gets the planned path of occupancy map points.
        /// </summary>
        [DataMember]
        public IEnumerable<Point2D<int>> Path { get; private set; }

        /// <summary>
        /// Gets the most likely robot pose.
        /// </summary>
        /// <remarks>Used for visualization.</remarks>
        [DataMember]
        public Pose2D CurrentPose { get; private set; }

        /// <summary>
        /// Gets the target robot pose.
        /// </summary>
        [DataMember]
        public Pose2D TargetPose { get; private set; }

        /// <summary>
        /// Gets the most likely global occupancy grid map.
        /// </summary>
        /// <remarks>Used for visualization.</remarks>
        [DataMember]
        public GlobalMap Map { get; private set; }
    }
}
